package com.wang.domain;

import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * 通过构造函数传入，spring默认会自动加载
 * 使用@Component注解注入spring容器中
 *
 * @Author wly
 * @Date 2018/7/10 17:36
 */
@Component
public class ApplicationContextBean3 {
    private ApplicationContext context;

    public ApplicationContextBean3(ApplicationContext context) {
        this.context = context;
    }

    public void show() {
        System.out.println("ApplicationContextBean3 is：" + context );
    }
}
